package com.tony.reactiveStream;

import reactor.core.publisher.Mono;

import java.util.Optional;

/**
 * @version V1.0  </br>
 * @ClassName MonoTest </br>
 * @Description TODO  </br>
 * @Author tonywang</br>
 * @DATE 3/14/2019 5:50 PM</br>
 */
public class MonoTest {
    public static void main(String[] args){
        Mono.fromSupplier(() -> "Hello").subscribe(System.out::println);
        Mono.justOrEmpty(Optional.of("Hello")).subscribe(System.out::println);
        Mono.create(sink -> sink.success("Hello")).subscribe(System.out::println);
    }
}
